package com.bawei.composeui2207a.day01

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.bawei.composeui2207a.R

/**
 * 作者：赵亮
 * 时间：2024/12/10 12:23
 * 功能：文本控件
 */
@Composable
fun Page2() {
    Column {

        // 颜色
        Text(text = "颜色", color = Color.Red)
        Text(text = "颜色", color = colorResource(id = R.color.my_text_color))

        // 大小
        Text(text = "大小", fontSize = 32.sp)

        // 背景 background  color背景颜色  shape形状 RoundedCornerShape圆角 CircleShape 圆形
        Text(
            text = "背景",
            color = Color.White,
            modifier = Modifier
                .background(color = Color.Red, shape = RoundedCornerShape(15.dp))
                .padding(horizontal = 20.dp, vertical = 10.dp),

        )

        Text(text = "其他", fontWeight = FontWeight.Bold)
    }
}

@Preview(showSystemUi = true)
@Composable
fun Page2Preview() {
    Page2()
}

